<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue模版语法</title>
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>
<body>
  <div id="app" v-cloak>
    <!-- 文本插值 -->
    <div>{{ msg }}</div>
    <!-- 表达式 -->
    <div>
      {{ count + 100 }}
    </div>
    <div>
      {{ msg.split(' ').reverse().join(' ') }}
    </div>
    <div>
      {{ msg.split('').reverse().join('') }}
    </div>

    <div id="user1"></div>
    <!-- 绑定属性 -->
    <div v-bind:id="'user' + count"></div>
    <div :id="'user' + count"></div>
    <div :id="`user${count}`"></div>
  </div>
</body>
<script src="../lib/vue.global.js"></script>
<script>
  const { createApp } = Vue

  const app = createApp({
    data () {
      return {
        count: 100,
        msg: '你好小程'
      }
    }
  })

  app.mount('#app')
</script>
</html>